home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / quartz / quartz10.lha / include / quartzcommon.h < prev    next >
C/C++ Source or Header  |  1990-04-29  |  3KB  |  126 lines

  1. /* Data structures shared between the Quartz pre-processor, runtime, and
  2.  * post-processor
  3.  */
  4.  
  5. /* Basic defines */
  6.  
  7. #ifndef NUMPROCS
  8. #define NUMPROCS        20        /* max we allow */
  9. #endif
  10. #ifndef ACCURACY
  11. #define ACCURACY     float
  12. #endif
  13. #ifndef NULL
  14. #define NULL 0
  15. #endif
  16. #ifndef FALSE
  17. #define FALSE    0
  18. #define TRUE    1
  19. #endif
  20.  
  21.  
  22. #define MaxEffectiveParallelism     (NUMPROCS)
  23. #define MaxNominalParallelism         (NUMPROCS * 2)
  24.  
  25. typedef ACCURACY FLOAT;
  26.  
  27. /* Enumerations */
  28.  
  29. /* Well-known procedure ids -- shared between pre-processor and runtime */
  30. /* 0 is taken */
  31. #define StartID            1
  32. #define IdleID            2
  33. #define ForkID            3
  34. #define InitProcs        4
  35.  
  36. /* Kinds of synchronization objects */
  37. #define VarSpinLock            0
  38. #define VarSpinDependency    1
  39. #define VarBlockLock        2
  40. #define VarBlockDependency    3
  41. #define VarThread            4
  42. #define VarProcedure        5        /* for post-processor */
  43.  
  44. /* thread states */
  45. #define BUSY            0
  46. #define SPIN            1
  47. #define BLOCKED            2
  48. #define READY            3
  49. #define NumStates        4
  50.  
  51. /* types of profiling data */
  52. #define MePlusKids        0
  53. #define    JustMe            1
  54. #define NumWho            2
  55.  
  56. /* Maximum number of queue lengths sampled per synchronization object */
  57. #define NumNumbers        2
  58.  
  59. /* The shared data structures between runtime and post-processor */
  60. typedef struct busy_data {
  61.     FLOAT byEffP[MaxEffectiveParallelism];
  62.     } BusyData;
  63.  
  64. typedef struct nominal_data {
  65.     FLOAT byNomP[NumWho][NumStates][2];            /* nomP >= P ? */
  66.     } NominalData;
  67.  
  68. typedef struct queue_length {
  69.     FLOAT length[NumNumbers][MaxNominalParallelism];
  70.     } QueueLength;
  71.  
  72. /* Actual data structures passed from runtime to post-processor
  73.  * DO NOT CHANGE, without changing dump.c
  74.  */
  75.  
  76. typedef struct measured_data {
  77.     BusyData busy;
  78.     NominalData nom;
  79.     QueueLength queue;
  80.     } MeasuredData;
  81.  
  82. /* Procedure data -- names come from munge */
  83. typedef struct proc_data {
  84.     int id;
  85.     MeasuredData meas;
  86.     } ProcData;
  87.  
  88. /* Synchronization object data -- names come from user */
  89. typedef struct synch_data {
  90.     char *name;
  91.     int kind;
  92.     int myID;
  93.     int parentID;
  94.     int hit;
  95.     MeasuredData meas;
  96.     } SynchData;
  97.  
  98. /* busy time propagated upward from this child */
  99. typedef struct KidData {
  100.     int    callerID;
  101.     int    calleeID;
  102.     BusyData busy;
  103.     } KidData;
  104.  
  105. /* traditional call-graph */
  106. typedef struct triple {
  107.     int    calleeID;
  108.     int    callerID;
  109.     int    num;
  110.     } Triple;
  111.  
  112. typedef struct quartz_data {
  113.     int numProcessors;
  114.     int numProcIds;
  115.     FLOAT timeDiff;
  116.     int numSamples;
  117.     ProcData *procData;
  118.     int numProcs;
  119.     SynchData *synchData;
  120.     int numSynch;
  121.     KidData *kidData;
  122.     int numKids;
  123.     Triple *triples;
  124.     int numTriples;
  125.     } QuartzData;
  126.